/**
 * 分页请求参数封装
 */
export function pageHelper(resObj) {
  let data = { ...resObj.data, orderBy: undefined, isAsc: undefined };
  let params = {
    pageNum: resObj.data.pageNum,
    pageSize: resObj.data.pageSize,
  };

  resObj.data = data;
  resObj.params = params;
  return resObj;
}

/**
 * el-table 排序调用
 */
export function sortChange(column, func) {
  let props = column.prop.split(".");
  this.queryParams.orderBy = props[props.length - 1];
  let isAsc = column.order == "ascending" ? true : false;
  this.queryParams.isAsc = isAsc;
  func ? func() : this.getList && this.getList();
}
